package com.maduar.mybatis.demo.service;

import com.maduar.mybatis.demo.User;
import com.maduar.mybatis.demo.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Description:
 *
 * @author maduar maduar@163.com
 * @date 2021-05-12 17:32
 */
@Component
@Slf4j
public class RemoteHystrix implements RemoteClient {

    @Override
    public Result<User> getUser(String name, int age) {
        User user = new User();
        user.setName(name);
        user.setAge(age);
        return Result.success(user);
    }

    @Override
    public Result<Integer> getAge() {
        return Result.success(0);
    }

    @Override
    public Result<User> addUser(User user) {
        log.error("addUser error: {}", user);
        return Result.success(user);
    }

    @Override
    public Result<Integer> getYourAge(Map<String, Object> queryMap) {
        return Result.success(0);
    }
}
